<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateApiTokenTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('api_token', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->string('token')->nullable(false)->comment('令牌');

            $table->integer('admins_id')->unsigned()->nullable(false)->comment('管理员id');

            $table->integer('expire_time')->unsigned()->nullable(false)->comment('过期时间');
        });


        DB::statement("ALTER TABLE `api_token` COMMENT='api令牌表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('api_token');
    }
}
